﻿using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal struct FrtRefHeaderU
    {
        internal ushort rt;
        internal FrtFlags grbitFrt;
        internal Ref8 ref8;

        public  void Read(BinaryReader reader)
        {
#if DEBUG
            ReadWriteChecker.CheckStruct((ref FrtRefHeaderU t, BinaryReader r) => t.Read(r),
                                         (ref FrtRefHeaderU t, BinaryWriter w) => t.Write(w), reader, ref this);
#endif
            this.rt = reader.ReadUInt16();
            this.grbitFrt = (FrtFlags)reader.ReadUInt16();
            ref8.Read(reader);
        }

        public void Write(BinaryWriter writer)
        {
            writer.Write(rt);
            writer.Write((ushort)grbitFrt);
            ref8.Write(writer);
        }
    }
}